(1.4.6) Design pattern
With the word "pattern," some people remember the design pattern. The design pattern is a named structure that repeatedly appears in the design of the program. For example, rather than to allow multiple things are interacting with each other, we can create what mediates interactions. It is a "mediator pattern." Let's compare it to human activities. When holding an event where multiple people participate, if all the participants talk to each other on a one-on-one basis for schedule adjusting, it becomes confusing. So we usually use one mediator (secretary) to collect and summarize information. https://gyazo.com/42b56e2594304c3b4d34b9641c6cc558
Fig: Medietor decleases the number of interactions
The design pattern was initially born in the field of architecture. They are the name given to the structure that repeatedly appears in the design of the town and the building. For example, the pattern "door" is very common as a design to solve the problem that people sometimes want to pass but the other case it should be like a wall. You may have seen various types of doors.
In both cases of programming and architecture, the problem to be solved is repeatedly generated in a slightly different way, so that a similar structure repeatedly appears in its solution method.
---
Footnotes:
*37: Gamma, E., 1995. Design patterns: elements of reusable object-oriented software. Pearson Education India.
*38: mediator = person who mediate the exchange of things or information
*39: Alexander, C., 1977. A pattern language: towns, buildings, construction. Oxford university press.
*40: The example of the door pattern comes from "The Timeless Way of Building" by Alexander
en.icon
---
This page is auto-translated from /nishio/(1.4.6) Design pattern. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.